/**
 * RegistryServerConfig.java
 */
package fss.core.config;

import java.util.ArrayList;

/**
 * Registry Server Config (somewhat-POJO).
 * 
 * @author thinh
 *
 */
public class ServiceRegistryConfig {
    /**
     * List of hostname(s).
     */
    private ArrayList<String> hostList = new ArrayList<String>();
    /**
     * List of port(s).
     */
    private ArrayList<Integer> portList = new ArrayList<Integer>();
    /**
     * Get the port list.
     * @return list of port(s).
     */
    public ArrayList<Integer> getPortList() {
        return portList;
    }
    /**
     * Add a port.
     * @param port the port.
     */
    public void addPort(int port) {
        portList.add(port);
    }
    /**
     * Get the host list.
     * @return the host list.
     */
    public ArrayList<String> getHostList() {
        return hostList;
    }
    /**
     * Add to the host list. Package-protected on purpose.
     * @param host the host.
     */
    void addHost(String host) {
        if(host == null) throw new IllegalArgumentException("Cannot add a null host name.");
        hostList.add(host);
    }
}
